import os
from collections import OrderedDict

STAC_VERSION = "v1.0.0"
STAC_JSON_SCHEMAS = OrderedDict()

# core schemas
STAC_JSON_SCHEMAS[
    "catalog"
] = "https://schemas.stacspec.org/v1.0.0/catalog-spec/json-schema/catalog.json#"
STAC_JSON_SCHEMAS[
    "collection"
] = "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json#"
STAC_JSON_SCHEMAS[
    "item"
] = "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#"

# extension schemas
STAC_JSON_SCHEMAS[
    "sat"  # satellite
] = "https://schemas.stacspec.org/v1.0.0/extensions/sat/json-schema/schema.json#"
STAC_JSON_SCHEMAS[
    "eo"  # electro-optical
] = "https://schemas.stacspec.org/v1.0.0/extensions/eo/json-schema/schema.json#"
STAC_JSON_SCHEMAS[
    "view"  # satellite sensor viewing geometry
] = "https://schemas.stacspec.org/v1.0.0/extensions/view/json-schema/schema.json#"
STAC_JSON_SCHEMAS[
    "projection"  # projection and coordinate system
] = "https://schemas.stacspec.org/v1.0.0/extensions/projection/json-schema/schema.json#"
STAC_JSON_SCHEMAS[
    "timestamps"  # extended timestamps of item/asset for better managing
] = "https://schemas.stacspec.org/v1.0.0/extensions/timestamps/json-schema/schema.json#"
STAC_JSON_SCHEMAS[
    "item-assets"  # fields in collection to describe expected assets in items belong to this collection
] = "https://schemas.stacspec.org/v1.0.0/extensions/item-assets/json-schema/schema.json#"
STAC_JSON_SCHEMAS[
    "file"  # file metadata
] = "https://schemas.stacspec.org/v1.0.0/extensions/file/json-schema/schema.json#"

# our own extension schemas
DIR_PAII_EXTENSIONS = os.path.join(
    os.path.dirname(os.path.abspath(__file__)), "schemas", "extensions"
)
# optical data
STAC_JSON_SCHEMAS["paii-optical"] = os.path.join(
    DIR_PAII_EXTENSIONS, "paii-optical/json-schema/schema.json"
)
# more timestamps for managing data lifecycle
STAC_JSON_SCHEMAS["paii-lifecycle"] = os.path.join(
    DIR_PAII_EXTENSIONS, "paii-lifecycle/json-schema/schema.json"
)
